﻿<Page 
    x:Class="Milkify.Views.TaskListListControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:Milkify" 
    Title="{Binding Title}"
    KeepAlive="True">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="Auto" />
      </Grid.RowDefinitions>
      <ScrollViewer
          VerticalScrollBarVisibility="Auto">
          <ItemsControl
              Name="ListTaskLists"
              ItemsSource="{Binding TaskLists}"
              KeyboardNavigation.IsTabStop="False"
              KeyboardNavigation.DirectionalNavigation="Cycle"
              KeyboardNavigation.TabNavigation="Once"
              Grid.IsSharedSizeScope="True"
              Style="{DynamicResource TaskListListStyle}">
              <ItemsControl.ItemTemplate>
                  <DataTemplate>
                      <Button
                          Name="ButtonTaskList"
                          Content="{Binding}"
                          ContentTemplate="{StaticResource TaskListItem}"
                          Command="{Binding ElementName=ListTaskLists, Path=DataContext.NavigateToTaskListCommand}"
                          CommandParameter="{Binding}"
                          Style="{DynamicResource TaskListButtonStyle}"
                          Click="ButtonTaskList_Click" />
                  </DataTemplate>
              </ItemsControl.ItemTemplate>
          </ItemsControl>
      </ScrollViewer>
      <Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto" />
          <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <CheckBox IsChecked="{Binding ShowArchivedLists}" />
        <TextBlock Grid.Column="1">Show archived lists</TextBlock>
      </Grid>
    </Grid>
</Page>
